FROM openjdk:8-jre-alpine
# 设置工作目录
WORKDIR /app


# 复制打包好的 jar 文件和配置文件到镜像中
COPY ./target/dynabook-oa-0.0.1-SNAPSHOT.jar ./
COPY ./src/main/resources/application.yml ./

# 设置 JVM 参数环境变量
ENV JAVA_OPTS="-Xms256m -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005"

# 暴露应用端口和调试端口
EXPOSE 8102
EXPOSE 5005


# 启动应用（使用 JSON 格式）
CMD ["java", "-Xms256m", "-Xmx512m", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005", "-jar", "dynabook-oa-0.0.1-SNAPSHOT.jar", "--spring.config.location=file:./application.yml"]